import { instance } from '@/http/index'
import { ApiResponseVo } from '@/types/vo'

import { LoginDto } from './type/dto'
import { CaptchaData, Jwt, Permissions } from './type/vo'

export const login = (data: LoginDto): Promise<ApiResponseVo<Jwt>> => instance.post('/sign-in', data)

export const getVCode = (): Promise<ApiResponseVo<CaptchaData>> => instance.post('/captcha/image')

export const getPermission = (): Promise<ApiResponseVo<Permissions>> => instance.post('/get-permissions')
